/**
 * Created by jacky on 2017/4/26.
 * banker developer jacky</br>
 */

import React, {Component} from 'react'
import TodoList from './TodoList'
import ListStore from './listStore'

import {
    Navigator
} from 'react-native'

class ReactNativeMobX extends Component {
    renderScene(route, navigator) {
        return <route.component {...route.passProps} navigator={navigator}/>
    }

    configureScene(route, routeStack) {
        if (route.type === 'Modal') {
            return Navigator.SceneConfigs.FloatFromBottom
        }
        return Navigator.SceneConfigs.PushFromRight
    }

    render() {
        return (
            <Navigator
                configureScene={this.configureScene.bind(this)}
                renderScene={this.renderScene.bind(this)}
                initialRoute={{
                    component: TodoList,
                    passProps: {
                        store: ListStore
                    }
                }}/>
        )
    }
}

export default ReactNativeMobX

